package com.companion.companion.service.impl;

import java.util.List;

import com.companion.companion.domain.Message;
import com.companion.companion.mapper.MessageMapper;
import com.companion.companion.service.IMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 聊天消息记录Service业务层处理
 * 
 * @author zly
 * @date 2025-05-06
 */
@Service
public class MessageServiceImpl implements IMessageService
{
    @Autowired
    private MessageMapper messageMapper;

    /**
     * 查询聊天消息记录
     * 
     * @param messageId 聊天消息记录主键
     * @return 聊天消息记录
     */
    @Override
    public Message selectMessageByMessageId(Long messageId)
    {
        return messageMapper.selectMessageByMessageId(messageId);
    }

    /**
     * 查询聊天消息记录列表
     * 
     * @param message 聊天消息记录
     * @return 聊天消息记录
     */
    @Override
    public List<Message> selectMessageList(Message message)
    {
        return messageMapper.selectMessageList(message);
    }

    /**
     * 新增聊天消息记录
     * 
     * @param message 聊天消息记录
     * @return 结果
     */
    @Override
    public int insertMessage(Message message)
    {
        return messageMapper.insertMessage(message);
    }

    /**
     * 修改聊天消息记录
     * 
     * @param message 聊天消息记录
     * @return 结果
     */
    @Override
    public int updateMessage(Message message)
    {
        return messageMapper.updateMessage(message);
    }

    /**
     * 批量删除聊天消息记录
     * 
     * @param messageIds 需要删除的聊天消息记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageByMessageIds(Long[] messageIds)
    {
        return messageMapper.deleteMessageByMessageIds(messageIds);
    }

    /**
     * 删除聊天消息记录信息
     * 
     * @param messageId 聊天消息记录主键
     * @return 结果
     */
    @Override
    public int deleteMessageByMessageId(Long messageId)
    {
        return messageMapper.deleteMessageByMessageId(messageId);
    }
}
